<template>
	<view class="notice">
		<view  v-if="list.length">
			<view class="item" v-for="item in list"  @click="godetail(item)">
				<view class="cont">
					{{item.title}}
				</view>
				<u-icon name="arrow-right" color="rgba(87, 91, 93, 1)" size="28"></u-icon>
			</view>
		</view>
		
		<view v-else class="empty" style="padding-top: 150px;">
			<view v-if="!list.length && senDate" class="emptyAddress-box">
				<u-empty text="暂无内容" mode="news"></u-empty>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
				senDate: false,
			}
		},
		onShow() {
			this.senDate = false;
			this.$u.api.listByGroup({
					groupCode: "APP_NOTICE"
				})
				.then(res => {
					this.senDate = true;
					this.list = res.data
				});
		},
		methods:{
			godetail(e) {
				console.log(e,2222);
				
				uni.navigateTo({
					url: "/pages/sys/home/noticeDetail?code=" + e.code
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.notice {
		padding: 20rpx 40rpx;

		.item {
			padding: 24rpx 0;
			border-bottom: 1rpx solid #F5F5F5;
			font-family: Alibaba PuHuiTi, Alibaba PuHuiTi;
			font-weight: 400;
			font-size: 28rpx;
			color: #0F1417;
			line-height: 33rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;

			&:last-child {
				border-bottom: none;
			}

			.cont {
				margin-right: 10rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				display: -webkit-box;
				-webkit-box-orient: vertical;
				-webkit-line-clamp: 1;
				flex: 1;
			}
		}
	}
</style>
